package com.ly.cyclictest.test02;

import java.util.concurrent.CyclicBarrier;

public class Main {
    private static CyclicBarrier cyclicBarrier = new CyclicBarrier(10,new BarrierRun(10));

    public static void main(String[] args) {
        for(int i = 1;i<11;i++){
            System.out.println("士兵"+i+"报道");
            Thread thread = new Thread(new Solder(cyclicBarrier,"士兵" + i));
            thread.start();
        }
    }
}
